package tedu.api.io;

import java.io.*;

public class CopyDemo3Buffered {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("hsq.jpeg");
        BufferedInputStream bis = new BufferedInputStream(fis);
        FileOutputStream fos = new FileOutputStream("hsq_cp.jpeg");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        int b;
        long start = System.currentTimeMillis();
        while((b=bis.read())!=-1){
            bos.write(b);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完成"+(end-start)+"ms");

        bis.close();
        bos.close();

    }
}
